package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppAuditReportReview;
import com.ep.modules.app.service.AppAuditReportReviewService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/audit_report_review")
public class AppAuditReportReviewController {
    @Autowired
    private AppAuditReportReviewService appAuditReportReviewService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appAuditReportReviewService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppAuditReportReview appauditreportreview = appAuditReportReviewService.getById(id);
        return R.ok().put("appauditreportreview", appauditreportreview);
    }

    @SysLog("保存AppAuditReportReview")
    @PostMapping("/save")
    public R save(@RequestBody AppAuditReportReview appauditreportreview) {
        ValidatorUtils.validateEntity(appauditreportreview);
        appAuditReportReviewService.save(appauditreportreview);
        return R.ok();
    }

    @SysLog("修改AppAuditReportReview")
    @PostMapping("/update")
    public R update(@RequestBody AppAuditReportReview appauditreportreview) {
        ValidatorUtils.validateEntity(appauditreportreview);
        appAuditReportReviewService.update(appauditreportreview);
        return R.ok();
    }

    @SysLog("删除AppAuditReportReview")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appAuditReportReviewService.deleteBatch(ids);
        return R.ok();
    }
}